# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qt5-qtdocgallery
pkgver=0_git20200525
_commit="8cbbeb060188191b833863f23bc513909a9a4d0a"
pkgrel=0
arch="all"
url='http://qt-project.org/'
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only AND Qt-GPL-exception-1.0"
pkgdesc="Qt DocGallery (experimental)"
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev"
source="https://github.com/qt/qtdocgallery/archive/$_commit/qtdocgallery-$_commit.tar.gz
	0001-Set-MODULE_VERSION-to-5.0.0.patch
	"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/qtdocgallery-$_commit"
#options="!check" # No tests

build() {
	qmake-qt5 CONFIG+=git_build
	make
}

check() {
	make check
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
	find "$pkgdir/usr/lib" -type f -name '*.prl' \
		-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

	install -d "$pkgdir"/usr/share/licenses
	ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="89478da185c012b8477231c6ed84f707e7e945576f5eb1c00a12d64d69dd0f1d2afe49520ee536c6e19a6956406fe7579583ccd184e21b0e638fba3c343c3b8c  qtdocgallery-8cbbeb060188191b833863f23bc513909a9a4d0a.tar.gz
f5bd7a474112a5b77d9747c10b8b675bbad33b04f84c5111a706c7c483180c67295596144a3435d8137c4db2eb6a51e9da52eac9a67f876ee56ca79656d71081  0001-Set-MODULE_VERSION-to-5.0.0.patch"
